Skip to main content

Full text of "Arduino"

See other formats

Using the MakerShield - Servo Control 


Make Projects 

build, hack, tweak, share, discover,' 

Using the MakerShield - Servo 


Written By: Michael Castor 


Arduino Uno (1) 

Servo (generic) (1) 

USB A to B cable (1) 

Jumper Wire (1) 

Header pins, male, snap-off (1) 

MakerShield (1) 

Breadboard Mini Self-Adhesive (1) 

Ultimate Microcontroller Pack (1) 


Servos are very useful things; they provide precise movement in 180 degrees of motion. 
They are normally used in RC applications but can be fun when hooked up to an Arduino. 
This guide will show you how to hook a servo up to your Arduino and use the potentiometer 
on the Maker Shield to control it. 

© Make Projects Page 1 of 5 

Using the MakerShield - Servo Control 

First, let's get our parts together. You'll need an Arduino Uno, an assembled MakerShield 
with a mini breadboard, 4 jumper wires, a hobby RC servo, and 3 male header pins. 

Now, line up the pins on the MakerShield up with the holes in the Arduino and push it into 

Locate the Potentiometer - this is the blue knob thing on the upper left of the MakerShield. 
In front of it is a jumper to change the voltage going into the potentiometer from 3.3V to 5V. 
Make sure it is on 5V for the Arduino. 

The potentiometer input is now at 5V. The output voltage depends on the position of the 
knob. To read the output voltage, we'll have to connect the potentiometer output to an 
analog input on the Arduino. 

The potentiometer output is labeled as POT1 at the bottom of the MakerShield. Take a 
jumper wire and connect POT1 to the AO port on the left side of the MakerShield. 

Now your Arduino will be able to sense the voltage that comes from the knob position of 
the potentiometer. Easy, right? 

© Make Projects 

Page 2 of 5 

Using the MakerShield - Servo Control 

Lets get our 3 header pins. These, well, look like header pins! Usually they come in a long 
row so just cut (or break) off a section of 3 of them. 

Insert the header pins into the servo connector. You might have to slide the black piece 
that connects the header pins down about halfway to get a good connection. 

Finally, stick the header-pinned servo connector into the breadboard making sure to leave 
at least 1 row of holes in front of the connector. 

• Next, we're going to connect the positive and negative wires on the servo to +5 volts and 
ground on the Arduino. 

• The BROWN wire on the servo is the ground. Take a jumper wire and connect one end to 
the GND pin on the MakerShield and the other end to the hole right in front of the brown 
wire on the servo connector. 

• The RED wire the positive. Connect one end of the jumper wire to the 5V pin on the Maker 
Shield and connect the other end to the hole in the breadboard in front of the red wire on 
the servo connector. 

© Make Projects 

Page 3 of 5 

Using the MakerShield - Servo Control 

The ORANGE wire on the servo is for a PWM signal. Take a jumper wire and connect one 
end to the hole in front of the orange wire on the servo connector. Attach the other end to 
pin D9 on the MakerShield. 

Now, grab your USB cord because we're going to connect this thing to the computer and 
make it work! 

•Include -<>ii -i ■!»■ 

4*rvv *qrt*r**-i ft prttfi* wrro (*}«* %*> wire! p v*tyv 
" ftttpln m ti // analog ewi u:ea la (AriiKt the ^£o*i*ft'.«* 

ml lfll; ,■'.■' Wt»lf t« r(S*l liie Ttflu* !re« (!"* itwIcmj Pin 

•ys4m.atl«dh^)i // «* hochr-s tt» kemi on ptn 9 to Ita sm» object 

va? - i-xfwiL, 6, SKI. 0, I'M); 

// l"*Oflf Urn veil* Uf [h* HMnfctWUr < 

/.' nole t( lo use it with the »rvq («ol 
// i«T.: th* £«Tvo paaLLLcn aotactilng i* t 

• Now, plug one end of your USB cable into your Arduino and the other end into your 

• Fire up the Arduino software. 

• Go to File -> Examples -> Servo -> Knob and click on it. 

• This will load the Knob code into the Arduino IDE. Go ahead and hit the upload button to 
send the file to the Arduino. 

• Notice any noises? This is the servo aligning itself. 

© Make Projects 

Page 4 of 5 

Using the MakerShield - Servo Control 

Now twist the knob on the potentiometer. See the servo move? Cool, huh? 

Fast or slow, the servo follows the position of the potentiometer. How great is this? 

Now you can let your imagination run wild! Try plugging in an RC car speed control or hook 
the servo up to an arm for fun. Play around and enjoy. That's how you learn! 

See, that wasn't so hard, was it? Now you can control the servo using the potentiometer! Now 
you can build animatronics, robotic arms, and lots of other great stuff! 

This document was last generated on 201 2-1 0-31 1 2:20:49 AM. 

© Make Projects 

Page 5 of 5